package com.car.loan;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.spring.web.SpringfoxWebMvcConfiguration;
/**
 * 启动程序
 *
 * @author ruoyi
 */
@SpringBootApplication(exclude = {
    DataSourceAutoConfiguration.class}, scanBasePackages = "com.car.loan")
@ConditionalOnClass(SpringfoxWebMvcConfiguration.class)
@MapperScan("com.car.loan.project.**.mapper")
@EnableAsync //开启异步调用
public class RuoYiApplication implements WebMvcConfigurer {

    public static void main(String[] args) {
        SpringApplication.run(RuoYiApplication.class, args);
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("doc.html")
            .addResourceLocations("classpath:/META-INF/resources/");
        registry.addResourceHandler("/webjars/**")
            .addResourceLocations("classpath:/META-INF/resources/webjars/");
    }
}
